import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',

    redirect: '/login/index'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/home/index',
        name: '首页',
        component: () => import('../views/home/index/index.vue')
      },
      {
        path: '/home/member',
        name: '会员管理',
        component: () => import('../views/home/member/index.vue'),
      },
      {
        path: '/home/order',
        name: '订单管理',
        component: () => import('../views/home/order/index.vue'),
      },
      {
        path: '/home/add',
        name: '新增',
        component: () => import('../views/home/add/add.vue'),
      },
      {
        path: '/home/product',
        name: 'product',

        children: [
          {
            path: '/home/product/product',
            name: '产品管理',
            component: () => import('../views/home/product/product/index.vue'),
          },
          {
            path: '/home/product/classify',
            name: '分类管理',
            component: () => import('../views/home/product/classify/index.vue'),
          },
          {
            path: '/home/product/divide',
            name: '分组管理',
            component: () => import('../views/home/product/divide/index.vue'),
          },
          {
            path: '/home/product/comment',
            name: '评论管理',
            component: () => import('../views/home/product/comment/index.vue'),
          },
          {
            path: '/home/product/specifications',
            name: '规格管理',
            component: () => import('../views/home/product/specifications/index.vue'),
          },
        ]
      },
      {
        path: '/home/shop',
        name: 'shop',

        children: [
          {
            path: '/home/shop/announcement',
            name: '公告管理',
            component: () => import('../views/home/shop/announcement/index.vue'),
          },
          {
            path: '/home/shop/self',
            name: '自提点管理',
            component: () => import('../views/home/shop/self/index.vue'),
          },
          {
            path: '/home/shop/shopping',
            name: '运费模板',
            component: () => import('../views/home/shop/shopping/index.vue'),
          },
          {
            path: '/home/shop/carousel',
            name: '轮播图管理',
            component: () => import('../views/home/shop/carousel/index.vue'),
          },
          {
            path: '/home/shop/hot',
            name: '热搜管理',
            component: () => import('../views/home/shop/hot/index.vue'),
          },
        ]
      },
      {
        path: '/home/system',
        name: 'system',

        children: [
          {
            path: '/home/system/address',
            name: '地址管理',
            component: () => import('../views/home/system/address/index.vue'),
          },
          {
            path: '/home/system/managers',
            name: '管理员列表',
            component: () => import('../views/home/system/managers/index.vue'),
          },
          {
            path: '/home/system/role',
            name: '角色管理',
            component: () => import('../views/home/system/role/index.vue'),
          },
          {
            path: '/home/system/menu',
            name: '菜单管理',
            component: () => import('../views/home/system/menu/index.vue'),
          },
          {
            path: '/home/system/cron',
            name: '定时任务',
            component: () => import('../views/home/system/cron/index.vue'),
          },
          {
            path: '/home/system/parameter',
            name: '参数管理',
            component: () => import('../views/home/system/parameter/index.vue'),
          },
          {
            path: '/home/system/systemlog',
            name: '系统日志',
            component: () => import('../views/home/system/systemlog/index.vue'),
          },

        ]
      },
    ]
  },
  {
    path: '/login/index',
    name: 'login',
    component: () => import('../views/login/login.vue'),
  }

]

export default createRouter({
  history: createWebHashHistory(),
  routes
})

